package com.woniuxy.controller;

import com.woniuxy.dto.ProductDto;
import com.woniuxy.entity.ResponseEntity;
import com.woniuxy.service.CartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: 曾令忠
 * @Description:
 * @Date: 2020/7/3 0003-下午 2:21
 */
@RestController
@RequestMapping("/cart")
public class CartController {
    @Autowired
    private CartService cartService;
    @RequestMapping("/add")
    public ResponseEntity<Void> addCart(ProductDto productDto){
        ResponseEntity<Void> re = new ResponseEntity<>();
        int code = cartService.add(productDto);
        re.setCode(1);
        return re;

    }

}
